<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../include/conn.asp" -->
<!--#include file="contentfun.asp" -->
<% call chkAdmin("|12") %>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3c.org/tr/1999/rec-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>加添<%=sorttypename%></title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="../ZKeditor/themes/default/default.css" />
<link rel="stylesheet" href="../ZKeditor/plugins/code/prettify.css" />
<script type="text/javascript" src="../ZKeditor/kindeditor.js"></script>
<script type="text/javascript" src="../ZKeditor/plugins/code/prettify.js"></script>
<script type="text/javascript">
KindEditor.ready(function(K) {
    var editor = K.create('textarea[name="content"]', {
        cssPath : '../ZKeditor/plugins/code/prettify.css',
        uploadJson : '../ZKeditor/asp/upload_json.asp',
        fileManagerJson : '../ZKeditor/asp/file_manager_json.asp',
        //urlType : 'relative',
		allowFileManager : true,
        afterCreate : function() {
            var self = this;
            K.ctrl(document, 13, function() {
                self.sync();
                K('form[name=add]')[0].submit();
            });
            K.ctrl(self.edit.doc, 13, function() {
                self.sync();
                K('form[name=add]')[0].submit();
            });
	K('#insertHtml').click(function(e) {
		editor.insertHtml('[==华==丽==的==分==页==码==]');
	});
        },
		afterBlur: function(){this.sync();}
		
    });
    prettyPrint();

});
</script>
<script type="text/javascript">
function check(form) {
	if(form.local.checked) {//判断选中时执行
		 // alert("地址不能为空!");
		  document.getElementById('one').innerHTML='<font color="#FF0000">远程图片正在本地化...请等待！</font>';
		  form.local.focus();
		  //return false;  //注释后继续执行
	 }
return true;
}
/*设置图片缩略图*/
function setimg(t)
{
document.getElementById("img").value=t
}
/*删除图片*/
function dropThisDiv(t,p)
{
document.getElementById(t).style.display='none'
var str =document.getElementById("ImagePath").value;
var arr = str.split("|");
var nstr="";
for (var i=0; i<arr.length; i++)
{
	if(arr[i]!=p)
	{
		if (nstr!="")
		{
			nstr=nstr+"|";
		}		
		nstr=nstr+arr[i]
	}
}
document.getElementById("ImagePath").value=nstr;
}
/*设置增加图组*/
function valMsg(strValue){
	if (strValue=="") return;
	var objLinkUpload =document.getElementsByName("ImagePath")[0];
	if (objLinkUpload){
		if (objLinkUpload.value!=""){
			objLinkUpload.value = objLinkUpload.value + "|";
		}
		objLinkUpload.value = objLinkUpload.value + strValue;
	}
}
/*浏览图片返回*/
KindEditor.ready(function(K) {
var editor = K.editor({
	fileManagerJson : '../ZKeditor/asp/file_manager_json.asp'
});
K('#flash').click(function() {
	editor.loadPlugin('filemanager', function() {
		editor.plugin.filemanagerDialog({
			viewType : 'VIEW',
			dirName : 'image',
			urlType : 'relative',
			clickFn : function(url, title) {
				K('#img').val(url);
				var pw=document.getElementById("pw").innerHTML;
				var ids=url
				   ids=ids.substr(ids.lastIndexOf("/")+1,ids.lastIndexOf("."))
				   ids=ids.replace(".","")
				var div=pw+'<div class="imgDiv" id="'+ids+'"><label><img src="'+ url + '" border="0" /><br><input type="radio" name="imgradio" onclick="setimg(\''+url+'\')" value="'+url+'" />设为缩略图</label> <a href="javascript:dropThisDiv(\''+ids+'\',\''+url+'\')">删除</a></div>'
				
				K('#pw').html(div);
				K('#ImagePath').val(valMsg(url));
				editor.hideDialog();
			}
		});
	});
}); 

K('#annex').click(function() {
	editor.loadPlugin('filemanager', function() {
		editor.plugin.filemanagerDialog({
			viewType : 'VIEW',
			dirName : 'file',
			urlType : 'relative',
			clickFn : function(url, title) {
				K('#downurl').val(url);
				editor.hideDialog();
			}
		});
	});
});  
  });
</script>
<style type="text/css">
<!--
#pw{position:relative; overflow:hidden; display:inline-block;background:#FFF;border-right:1px #CCC solid}
.imgDiv{float:left; padding:5px;border:1px #ccc solid; background:#F2F2F2;margin-right:-1px}
.imgDiv img{width:110px;height:70px; margin:0px auto;border:1px #CCC solid}
.imgDiv img:hover{ border:1px #CC0000 solid}
-->
</style>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form name="form" action="?action=add<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&"&id="&Cid&""%>" method="post" >
  <tr>
    <td height="30" class="topnav"><div  style="padding-left:10px;font-weight:bold;color:#ffffff">添加<%=sorttypename%></div></td>
  </tr>
  <tr>
    <td class=td  bgcolor="#ffffff">
    <table width="100%" border=0 align=center cellpadding=2 cellspacing=0 class="stable">
  <tbody>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td class=td  align="right" width="120">频道分类</td>    
    <td class=td>
	<%loadselect "sortid","zych_type","sortname","sortid",sortid, 0,"and TopSortID="&sortid&" and SortURL="" "" order by px_id","请选择分类",0,""%>
    标题颜色<input id="colorPicker"  name="titlecolor" type="text" value="" style="width:80px" class="inp" />
    <script src="images/Deepteach_colorPicker.js"></script>
    </td>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">						
    <td align=right class=td>文章标题</td>
    <td class=td><input name="title" class="inp" id="title" style="width:400px" maxlength="200"/> 已输入<span style="color:#c00" id="info"> </span>个字/200.  <font color=#ff0000>*</font>
<script> 
/*标题字数*/
$(function(){
document.getElementById("info").innerText =0; 
document.getElementById("title").onkeyup = function() 
{ 
document.getElementById("info").innerText = document.getElementById("title").value.length; 
} 
});
</script></td>
  </tr>
   
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>文章作者</td>
    <td class=td><input name="author" class="inp" style="width:100px" value="<%=zsname%>" maxlength="200"/>  来源 <input class="inp" maxlength="200" style="width:100px" name="contentsource" />
      浏览次数
      <input class="inp" maxlength="6" value="0" style="width: 60px" name="visits"/>
      排序 
      <input class="inp" maxlength="6" value="0" style="width: 60px" name="px_id"/></td>
    </tr>
    <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>关键词</td>
    <td class=td>
      <input type="hidden" name="isgenerated" value="1"/> <input class="inp" maxlength="200" style="width:400px"  name="pagekeywords"/> <%=fileext%> </td>
  </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>页面描述</td>
    <td class=td>  <textarea class="tex" style="width: 450px" name="pagedesc" rows="3"></textarea>    </td>
  </tr>
<%if sorttype=4 then%>
<td class="td" align="right" height="30">原价</td>
<td class="td" colspan="3"> <input type="text" class="inp" maxlength="100" value="" name="yrmb" style="width:200px">
</td>
</tr>
<tr>
<td class="td" align="right" height="30">现价</td>
<td class="td" colspan="3"> <input type="text" class="inp" maxlength="100" value="" name="xrmb" style="width:200px">
</td>
</tr>
<% End If %>
   <%=getfield(0,sortid)%>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>外链地址 </td>
    <td class=td><input class="inp" maxlength="200" style="width: 200px" name="outlink"  />
      <label class="inp"><input type="checkbox" name="isoutlink" value="1" />转向链接</label></td>
    </tr> 
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>内容详情<br><a href="javascript:void(0)" id="insertHtml">插入分页</a></td>
    <td class=td><textarea  name="content" id="content" rows="3" style="width:750px; height:400px"></textarea></td>
  </tr>

    <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>缩略图</td>
      <td class=td ><label class="inp"><input name="simg" type="radio" value="1" onClick="Date1.style.display='none'" checked />使用第一张图做为缩略图</label> 
      <label class="inp"><input name="simg" type="radio" value="2" onClick="Date1.style.display=''" />重新上传图组</label></td>
    </tr>
    <tr  id="Date1" style="display:none" onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right valign="middle" class=td>图片组</td>
      <td class=td>
      <table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><input class="inp" style="width:350px" name="img" type="text" id="img" size="70" value="" /></td>
    <td><input name="flash" type="button" class="button" id="flash" value="选取已上传" /></td>
    <td><iframe src="up.asp?formname=form&amp;inputname=img&amp;uploadstyle=News" frameborder="0" scrolling="no" width="250" height="28"></iframe></td>
  </tr>
</table>
<input name="ImagePath" type="hidden" id="ImagePath" value="<%=ImagePath%>" size="60" />
<div id="pw"></div>
</td>
    </tr> 
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td class=td align=right width=120 height=30>附件地址</td>
    <td class=td><table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><input class="inp" maxlength="255" style="width:350px;float:left" id="downurl"  name="downurl" value="" /></td>
    <td><input name="flash" type="button" class="button" id="annex" value="选取已上传" /></td>
    <td><iframe style="float:left" src="up.asp?formname=add&amp;inputname=downurl&amp;uploadstyle=file" frameborder="0" scrolling="no" width="250" height="28"></iframe></td>
  </tr>
</table>

    
        </td>
  </tr>
 
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>阅读权限</td>
    <td class=td >
      <select name="star" class="sel">
        <option value="0" selected>网站游客</option>
		<%set rsc=server.CreateObject("adodb.recordset")
        rsc.open "select * from user_fl order by px_id asc",conn,1,1
		if rsc.eof then
		response.write""
		else
        while not rsc.eof
        response.Write("<option value="""&rsc("id")&""">"&rsc("title")&"</option>")      
        rsc.movenext
        wend
		end if
        rsc.close
        set rsc=nothing%> 
      </select></td>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td class=td  align=right width=119 height=30>发布时间</td>
    <td class=td ><input class="inp" maxlength="10" value="<%=now()%>" onClick="WdatePicker({dateFmt:'yyyy/MM/dd HH:mm:ss'})" style="width:120px" name="addtime"/><input name=button type=button class="btn" onClick="document.add.addtime.value='<%=(now)%>'" value="设为当前时间"></td>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>功能选项</td>
    <td class=td><label class="inp"><input type="checkbox" name="istop" value="1"/>置顶</label>
    <label class="inp"><input type="checkbox" name="tuijian" value="1"/>推荐</label> 
    <label class="inp"><input type="checkbox" name="tuwen" value="1"/>图文</label>
    <label class="inp"><input type="checkbox" checked="checked" name="isok" value="1"/>发布</label>
    <label class="inp"><input name="local" type="checkbox"  id="local" value="1">远程图片到本地</label> <span id="one">远程下载图片需要时间，可能会有延迟!</span></td>
  </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>&nbsp;</td>
    <td class=td><input type="hidden" maxlength="200"  name="sorttype" value="<%=sorttype%>"/> 
    <input class="btn" type="submit" value=" 添 加 " />&nbsp;&nbsp;
    <input class="btn" type="button" value=" 返 回 " onClick="history.go(-1)"/> &nbsp;</td>
    </tr>
    </tbody></table></td>
  </tr>
</form>
</table>
<%call footer%>
</body>
</html>
